#pragma once
#include <memory>
#include <nice2d/component.h>
#include <nice2d/serializer.h>

#define AttributeTable_Move 1

class AttributeTable1D : public Component
{
public:
    AttributeTable1D();
    ~AttributeTable1D();
public:
    void add(int32_t key, int32_t valye);
    std::optional<int32_t> get(int32_t key);
public:
    PTree serialize() override;
    void deserialize(const PTree &mode) override;
private:
    std::unique_ptr<class AttributeTableData> data;
};

class AttributeTable2D : public Component
{
public:
    AttributeTable2D();
    ~AttributeTable2D();
public:
    void add(int32_t key1, int32_t key2, int32_t value);
    std::optional<int32_t> get(int32_t key1, int32_t key2);
public:
    PTree serialize() override;
    void deserialize(const PTree &mode) override;
private:
    std::unique_ptr<class AttributeTableData> data;
};

class AttributeTable3D : public Component
{
public:
    AttributeTable3D();
    ~AttributeTable3D();
public:
    void add(uint8_t spriteType, uint8_t tileType, uint8_t attributeType, int32_t value);
    std::optional<int32_t> get(uint8_t spriteType, uint8_t tileType, uint8_t attributeType);
public:
    PTree serialize() override;
    void deserialize(const PTree &mode) override;
private:
    std::unique_ptr<class AttributeTableData> data;
};
